<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../img/asset-favico.ico">
    <title>预约</title>
    <link rel="stylesheet" href="../css/page-health-order.css" />
</head>
<body data-spy="scroll" data-target="#myNavbar" data-offset="150">
<div class="app" id="app">
    <!-- 页面头部 -->
    <div class="top-header">
        <span class="f-left"><i class="icon-back" onclick="history.go(-1)"></i></span>
        <span class="center">千锋健康</span>
        <span class="f-right"><i class="icon-more"></i></span>
    </div>
    <!-- 页面内容 -->
    <div class="contentBox">
        <div class="list-column1">
            <div class="select-drop">
                <label for="" class="sex">性别</label>

                    <select v-model="gender" @change="change" style="border: 1px solid gray;height: 25px;width: 55px;border-radius: 5px">
                        <option value="0">不限</option>
                        <option value="1">男</option>
                        <option value="2">女</option>
                    </select>



            </div>
            <ul class="list">
                <li class="list-item"  v-for="setmeal in setmealList">
                    <a class="link-page" :href="'health-setmealDetail.html?id='+setmeal.id">
                        <img class="img-object f-left" :src="'http://localhost/img/' + setmeal.img" alt="">
                        <div class="item-body">
                            <h4 class="ellipsis item-title">{{setmeal.name}}</h4>
                            <p class="ellipsis-more item-desc">{{setmeal.remark}}</p>
                            <p class="item-keywords">
                                <span>{{setmeal.sex == '0' ? '性别不限' : setmeal.sex == '1' ? '男':'女'}}</span>
                                <span>{{setmeal.age}}</span>
                            </p>
                        </div>
                    </a>
                </li>
            </ul>
        </div>
    </div>
</div>
<!-- 页面 css js -->
<script src="../plugins/jquery/dist/jquery.min.js"></script>
<script src="../js/page-health-order.js"></script>
<script src="../js/vue.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<!--<script src="../js/page-health-order.js"></script>-->
</body>
<script>

    new Vue({

        el:'#app',
        data:{
            setmealList:[],
            // sexList:[],
            // aa:-1
            gender:"0"
        },
        methods:{
            change(){
                axios.get("/setmeal1/getSetmealSex?sex="+this.gender).then((res)=>{
                    if(res.data.code == 1000){
                        this.setmealList = res.data.data;
                    }else{
                        alert(res.data.msg);
                    }
                });
            }
        },

        // methods:{
        //     getSetMeal:function (){
        //
        //         console.log(this.aa)
        //
        //         let val1 = $("#sex1").val();
        //         alert(val1)
        //         axios.get("/setmeal1/getSetmealSex").then((res)=>{
        //             if(res.data.code == 1000){
        //                 this.sexList = res.data.data;
        //
        //             }else{
        //                 alert(res.data.msg);
        //             }
        //         });
        //     }
        // },
        mounted (){

            // 获取套餐列表数据
            axios.get("/setmeal1/getAllSetmeal").then((res)=>{

                if(res.data.code == 1000){
                    this.setmealList = res.data.data;

                }else{
                    alert(res.data.msg);
                }
            });

        },
        // watch:{
        //     modifi:function (newVal,oldVal){
        //         alert(newVal)
        //     }
        // }

    });
    // $('.filter-box').selectFilter({
    //     callBack: function(val) {
    //         //返回选择的值
    //         //					console.log(val+'-是返回的值')
    //         // console.log(val)
    //         // this.uid=val;
    //         $.ajax({
    //             "url": "/setmeal1/getSetmealSex",
    //             "type": 'post',
    //             "data":{"sex":val},
    //             "datatype":"json",
    //             "success":function (data) {
    //
    //             }
    //         });
    //
    //     }
    // });
</script>
